<h4 class="itemtitle">Comments</h4>
([foreachq item=item from=$comments])
<div style="border-bottom: 1px solid #ddd; padding: 0 0 5px;">
    ([if $item.com_title])<div><strong>([$item.com_title])</strong></div>([/if])
    
    <div style="background-color: #eee;padding: 3px;"><small>([$smarty.const._CM_POSTER]) <a href="([$xoops_url])/userinfo.php?uid=([$item.uid])">([$item.name])</a> ([$smarty.const._CM_POSTED]) ([$item.com_created]) IP：([$item.com_ip])</small></div>
    <div style="line-height: 22px;">
    <div style="float: left; margin: 5px 10px 5px 0;"><a href="([$xoops_url])/userinfo.php?uid=([$item.uid])"><img src="([$item.avatar])" alt="" /></a></div>
        ([$item.com_text])
    </div>
    <div class="clearfix"></div>
    ([if $item.com_uid eq $xoops_userid])
    <div style="line-height: 22px;"><a href="###" onclick="javascript:delComment(([$item.com_id]))">([$smarty.const._DELETE])</a></div>
    ([/if])
</div>
([/foreach])
([$pagenav])
<h4>([$smarty.const._CM_POSTCOMMENT])</h4>
([includeq file="db:comments_form.html"])
<script type="text/javascript">
    var JsPath = "([$xoops_url])/modules/comments/";
	$(document).ready(function(){
		$("#getCommentList div[id=xo-pagenav] a").click( function() {
		    var url = $(this).attr("href");
		    getCommentList(url);
			return false;
		});
	})
	function delComment(id) {
	    if ( confirm('Confirm delete this comment！') ) {
			$.ajax({
			 type: "POST",
			 url: JsPath + "action.ajax.php",
			 data:   "op=delcom&com_id=" + id,
			 success: function(msg){
			 	window.location.reload();
			 } 
			}); 
		} else {
			return false;
		}
	}
	function getCommentList(url) {
        $.ajax({
        	type: "GET",
        	url: url,
        	data:   "",
        	success: function(msg){ 
        		$("div[id=getCommentList]").html(msg);
        	} 
        });
	}
</script>
